#define _CRT_SECURE_NO_WARNINGS

//using namespace std;
//int main()
//{
//	int array[] = { 1, 2, 3, 4, 0, 5, 6, 7, 8, 9 };
//	int n = sizeof(array) / sizeof(int);
//	list<int> mylist(array, array + n);
//	auto it = mylist.begin();
//	while (it != mylist.end())
//	{
//		if (*it != 0)
//			cout << *it << " ";
//		else
//			it = mylist.erase(it);
//		++it;
//	}
//	return 0;
//}

///////////////////
#include"List.h"
#include<initializer_list>

using namespace std;
void test_list1()
{
	bit::list<int> lt;
	lt.push_back(1);
	lt.push_back(2);
	lt.push_back(3);
	lt.push_back(4);

	bit::list<int>::iterator it = lt.begin();
	while (it != lt.end())
	{
		cout << *it << " ";
		++it;
	}
	cout << endl;

	for (auto e : lt)
	{
		cout << e << " ";
	}
	cout << endl;
}

void test_list2()
{
	bit::list<int> lt;
	lt.push_back(1);
	lt.push_back(2);
	lt.push_back(3);
	lt.push_back(4);
	lt.push_front(-1);
	lt.push_front(-2);

	for (auto e : lt)
	{
		cout << e << " ";
	}
	cout << endl;

	lt.pop_back();
	lt.pop_back();
	lt.pop_front();
	lt.pop_front();

	for (auto e : lt)
	{
		cout << e << " ";
	}
	cout << endl;

	cout << lt.size() << endl;
}

void Print(const bit::list<int>& lt)
{
	bit::list<int>::const_iterator it = lt.begin();
	while (it != lt.end())
	{
		//*it = 1;
		cout << *it << " ";
		++it;
	}
	cout << endl;
}

void test_list3()
{
	bit::list<int> lt1 = { 1,2,3,4,5,6 };
	for (auto e : lt1)
	{
		cout << e << " ";
	}
	cout << endl;

	bit::list<int> lt2(lt1);
	for (auto e : lt2)
	{
		cout << e << " ";
	}
	cout << endl;

	bit::list<int> lt3 = { 10,20,30 };
	lt1 = lt3;
	for (auto e : lt1)
	{
		cout << e << " ";
	}
	cout << endl;

	Print(lt1);
}

int main()
{

	//test_list1();
	//test_list2();
	test_list3();

	return 0;
}

